#pragma once
#include <src/data/ParticleSet.h>
#include <src/algorithm/Eratosthenes.h>
#include <bitset>
#include <iomanip>
#include <src/data/poly_mod_2.h>

template<class T>
void check_prime(const Erathostenes<T> & from) {
	typedef std::set<T> container;
	typedef container::const_iterator const_iterator;
	bool logical = false;
	const_iterator begin	= from.first_list_.begin();
	begin ++;
	const_iterator end		= from.first_list_.end();
	for (;begin != end; ++ begin) {
		const_iterator next	= begin;
		next++;
		for (;next != end; ++ next) {
			T test = *next / *begin;
			T test1 = test * (*begin);
			if (test1 == *next) {
				std::cout << std::endl << "problem with prime : " << *next << std::endl;
				std::cout << std::endl << "we compute " << *next << "=" << *begin << "*" << test << std::endl ;
				OS_DYNAMIC_CHECK(false, "check_prime : eratosthenes prime search failed");
			};
		};
	};
};

void Eratosthenes_test();